package com.zzw.thread;

public class DepositSynThread extends Thread {

	private AccountSyn accountSyn;
	private double depositAmount;
	
	public DepositSynThread(){
		
	}
	
	public DepositSynThread(String name,AccountSyn accountSyn,double depositAmount){
		super(name);
		this.accountSyn = accountSyn;
		this.depositAmount = depositAmount;
	}
	
	public void run(){
		for (int i = 0; i < 10; i++) {
			try {
				accountSyn.deposit(depositAmount);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}